<template>
    <view class="nav_dh" :style="'height:60px'">
        <view class="navitem" @tap="jump(0)">
            <image class="nav_img" :src="stateClone == 0 ? '/static/sicon@2.png' : '/static/sicon@1.png'"></image>
            <view :class="'navtxt ' + (stateClone == 0 ? 'actxt' : '')">订单</view>
        </view>
        <view class="navitem" @tap="jump(1)">
            <image class="nav_img" :src="stateClone == 1 ? '/static/sicon@4.png' : '/static/sicon@3.png'"></image>
            <view :class="'navtxt ' + (stateClone == 1 ? 'actxt' : '')">我的</view>
        </view>
		<!--<view class="navitem" @tap="jump(2)" style="width: 230rpx;">
            <image class="nav_img1" :src="stateClone == 2 ? '/static/icon@5.png' : '/static/icon@5.png'"></image>
            <view :class="'navtxt ' + (stateClone == 2 ? 'actxt' : '')">排行</view>
        </view> -->
        <!-- <view class="navitem" @tap="jump(2)">
            <image class="nav_img" :src="stateClone == 2 ? '/static/icon@6.png' : '/static/icon@5.png'"></image>
            <view :class="'navtxt ' + (stateClone == 2 ? 'actxt' : '')">价目表</view>
        </view>
        <view class="navitem" @tap="jump(3)">
            <image class="nav_img" :src="stateClone == 3 ? '/static/icon@8.png' : '/static/icon@7.png'"></image>
            <view :class="'navtxt ' + (stateClone == 3 ? 'actxt' : '')">我的</view>
        </view> -->
        <!-- <image class="bg_01" src="/static/zicon.png"></image> -->
    </view>
</template>

<script>
const app = getApp();
export default {
    data() {
        return {
            img_src: app.globalData.img_src,
            navBarHeight: '',
            menuRight: '',
            menuBotton: '',
            menuHeight: '',
            typeClone: 0,
            stateClone: ''
        };
    },
    /**
     * 组件的属性列表
     */
    props: {
        title: {
            type: String,
            default: ''
        },
        state: {
            type: Number,
            default: 0
        },
    },
    created() {
        ////console.log(this.data.state)
    },
    /**
     * 组件的方法列表
     */
    methods: {
        attached: function () {
            const that = this;
            // 获取系统信息
            // const systemInfo = uni.getSystemInfoSync();
            // // 胶囊按钮位置信息
            // const menuButtonInfo = uni.getMenuButtonBoundingClientRect();
            // // 导航栏高度 = 状态栏到胶囊的间距（胶囊距上距离-状态栏高度） * 2 + 胶囊高度 + 状态栏高度
            // ////console.log((systemInfo))
            // this.navBarHeight = (menuButtonInfo.top - systemInfo.statusBarHeight) * 2 + menuButtonInfo.height + systemInfo.statusBarHeight
            // this.menuRight = systemInfo.screenWidth - menuButtonInfo.right
            // this.menuBotton = systemInfo.statusBarHeight
            // this.menuHeight = menuButtonInfo.height
        },

        cart() {
            this.setData({
                typeClone: 1
            });
        },

        gb_con() {
            this.setData({
                typeClone: 0
            });
        },

        jump(num) {
            if(num==0){
            	uni.reLaunch({
            		url:'/pages/technician/technician'
            	})
            }else{
            	uni.reLaunch({
            		url:'/pages/technician/my'
            	})
            }
        }
    },
    mounted() {
        // 处理小程序 attached 生命周期
        this.attached();
    },
    watch: {
        type: {
            handler: function (newVal, oldVal) {
                this.typeClone = newVal;
            },

            immediate: true
        },

        state: {
            handler: function (newVal, oldVal) {
                this.stateClone = 99;
            },

            immediate: true
        }
    }
};
</script>
<style>
.nav_dh {
    width: 100%;
    height: auto;
    display: table;
    background-color: #fff;
    position: fixed;
    left: 0px;
    bottom: 0px;
    z-index: 10;
	padding-top: 5px;
	border-top: 1px solid #ededed;
}
.navitem {
    width:50%;
    height: auto;
    display: table;
    float: left;
    z-index: 10;
    position: relative;
}
.nav_img {
    width: 29px;
    height: 29px;
    display: table;
    margin: auto;
    margin-top: 4px;
}
.navtxt {
    width: 100%;
    height: auto;
    display: table;
    font-size: 24rpx;
    color: #C7C7D0;
    text-align: center;
    line-height: 22px;
}
.nav_top {
    width: 100%;
    height: 10px;
    display: table;
    position: absolute;
    top: -10px;
    left: 0px;
}
.nav_img1 {
	width: 96px;
	height: 58.5761px;
	display: table;
	margin: auto;
	margin-top: -10px;
}
.actxt {
    color: #222;
}
.bg_01 {
    width: 750rpx;
    height: 10px;
    display: table;
    position: absolute;
    top: -10px;
    left: 0px;
}
</style>